package com.design.factory.NormalFactory;

/* 所有工厂模式都用来封装对象的创建，工厂方法模式通过让子类决定改创建的对象是什么，
*  来达到将对象创建的过程封装的目的  https://www.imooc.com/article/11675#comment
*/
//客户端的模拟过程
public class MainTestNormal {
 
	public static void main(String[] args) {
		PizzaStore nyStore = new NYPizzaStore();  			// ★★★有本质详解★★★
		PizzaStore chicagoStore = new ChicagoPizzaStore();
 
		Pizza pizza = nyStore.orderPizza("cheese");
		System.out.println("Ethan ordered a " + pizza.getName() + "\n");
		pizza = nyStore.orderPizza("clam");
		System.out.println("Ethan ordered a " + pizza.getName() + "\n");

		pizza = chicagoStore.orderPizza("cheese");
		System.out.println("Joel ordered a " + pizza.getName() + "\n");
		pizza = chicagoStore.orderPizza("clam");
		System.out.println("Joel ordered a " + pizza.getName() + "\n");


	}
}
